hers = ["钢铁侠","绿巨人", "黑寡妇", "鹰眼", "灭霸", "雷神"]

# 指定下标替换
hers[4] = "钢铁侠"
print(hers)

# 批量替换
hers[3 : ] = ["武松", "林冲", "李逵"]
print(hers)


nums = [3, 1, 9, 6, 8, 3, 5, 3]

# 列表反转
nums.reverse()
print(nums)

# 从小到大排序
nums.sort()
print(nums)

# 从大到小
nums = [3, 1, 9, 6, 8, 3, 5, 3]
nums.sort(reverse=True)
print(nums)

# 查询某个指定元素的个数
cnt = nums.count(3)
print(cnt)

# 查询指定元素的最小下标
idx = hers.index("绿巨人")
print(idx)
hers[hers.index("绿巨人")] = "神奇女侠"
print(hers)


nums = [3, 1, 9, 6, 8, 3, 5, 3]
# 指定范围查询下标
idx = nums.index(3, 1, 7)
print(idx)

# 复制列表-浅拷贝
nums_copy1 = nums.copy()
print(nums_copy1)
# 复制列表-浅拷贝
nums_copy2 = nums[:]
print(nums_copy2)